package health.lm.com.data;


import com.blankj.utilcode.util.SPUtils;

/**
 * 通用sp存储数据
 */

public class BaseSharedPreference {
    private SPUtils utils;
    private static BaseSharedPreference sp;

    /**
     * 用户token
     */
    private final static String ACCESS_TOKEN = "access_token";
    /**
     * 用户id
     */
    private final static String UID = "uid";
    /**
     * 切换到购物车页面
     */
    private final static String CART = "cart";
    /**
     * apkid
     */
    private final static String APK_ID = "apk_id";
    private final static String CITY = "city";
    private final static String CITY_ID = "city_id";
    private final static String LOCAL = "local";
    private final static String COIN_NAME = "coin_name";
    private final static String COIN_URL = "coin_url";
    private final static String SUGAR_NAME = "sugar_name";
    private final static String SUGAR_URL = "sugar_url";
    private final static String BOOT_IMG = "boot_img";
    private final static String BOOT_LINK = "boot_link";
    private final static String NICK_NAME = "nick_name";
    private final static String SYSTEM_TITLE = "system_title";//平台名称
    private final static String FIRST_LEVEL_TEAM = "first_level_team";//平台一级团队名称
    private final static String SECOND_LEVEL_TEAM = "second_level_team";//平台二级团队名称
    private final static String AGREEMENT_URL = "agreement_url";//平台协议地址
    private final static String TARGET_NUM = "target_num";//计步规定步数
    private final static String MENU_1 = "menu_1";//底部按钮首页
    private final static String MENU_2 = "menu_2";//底部按钮资讯
    private final static String MENU_3 = "menu_3";//底部按钮智库
    private final static String MENU_4 = "menu_4";//底部按钮体验店
    private final static String MENU_5 = "menu_5";//底部按钮我的

    private final static String LOADING_TITLE = "loading_title";//下拉刷新显示文字
    //圈子规则
    private final static String CIRCLE_URL = "circle_url";

    private BaseSharedPreference() {
        utils = SPUtils.getInstance("base");
    }

    public static synchronized BaseSharedPreference init() {
        if (sp == null) {
            sp = new BaseSharedPreference();
        }
        return sp;
    }

    public void clear() {
        utils.clear();
    }


    public String getCART() {
        return utils.getString(CART);
    }

    public void setAccessToken(String token) {
        utils.put(ACCESS_TOKEN, token);
    }

    public String getAccessToken() {
        return utils.getString(ACCESS_TOKEN);
    }

    public void setUID(String uid) {
        utils.put(UID, uid);
    }

    public String getUID() {
        return utils.getString(UID);
    }

    public void setCITY(String city) {
        utils.put(CITY, city);
    }

    public String getCITY() {
        return utils.getString(CITY);
    }

    public void setCITYID(String cityid) {
        utils.put(CITY_ID, cityid);
    }

    public String getCityId() {
        return utils.getString(CITY_ID);
    }

    public void setLOCAL(String local) {
        utils.put(LOCAL, local);
    }

    public String getLocal() {
        return utils.getString(LOCAL);
    }

    public void setCoin_name(String coin_name) {
        utils.put(COIN_NAME, coin_name);
    }

    public String getCoin_name() {
        return utils.getString(COIN_NAME);
    }

    public void setCoinUrl(String coin_url) {
        utils.put(COIN_URL, coin_url);
    }

    public String getCoin_url() {
        return utils.getString(COIN_URL);
    }

    public String getSugarName() {
        return utils.getString(SUGAR_NAME);
    }

    public void setSugarName(String sugarName) {
        utils.put(SUGAR_NAME, sugarName);
    }

    public void setSugarUrl(String sugarUrl) {
        utils.put(SUGAR_URL, sugarUrl);
    }

    public String getSugarUrl() {
        return utils.getString(SUGAR_URL);
    }

    public String getBootImg() {
        return utils.getString(BOOT_IMG);
    }

    public void setBootImg(String bootImg) {
        utils.put(BOOT_IMG, bootImg);
    }

    public void setBootLink(String bootLink) {
        utils.put(BOOT_LINK, bootLink);
    }

    public String getBootLink() {
        return utils.getString(BOOT_LINK);
    }

    public void setAPKID(Long b) {
        utils.put(APK_ID, b);
    }

    public Long getAPKID() {
        return utils.getLong(APK_ID);
    }

    public void setNICK_NAME(String nickName) {
        utils.put(NICK_NAME, nickName);
    }

    public String getNICK_NAME() {
        return utils.getString(NICK_NAME);
    }

    public String getSystemTitle() {
        return utils.getString(SYSTEM_TITLE);
    }

    public void setSystemTitle(String systemTitle) {
        utils.put(SYSTEM_TITLE, systemTitle);
    }

    public String getFirstLevelTeam() {
        return utils.getString(FIRST_LEVEL_TEAM);
    }

    public void setFirstLevelTeam(String firstLevelTeam) {
        utils.put(FIRST_LEVEL_TEAM, firstLevelTeam);
    }

    public String getSecondLevelTeam() {
        return utils.getString(SECOND_LEVEL_TEAM);
    }

    public void setSecondLevelTeam(String secondLevelTeam) {
        utils.put(SECOND_LEVEL_TEAM, secondLevelTeam);
    }

    public String getAgreementUrl() {
        return utils.getString(AGREEMENT_URL);
    }

    public void setAgreementUrl(String agreementUrl) {
        utils.put(AGREEMENT_URL, agreementUrl);
    }

    public static String getTargetNum() {
        return TARGET_NUM;
    }

    public void setTagetNum(String tagetNum) {
        utils.put(TARGET_NUM, tagetNum);
    }

    public static String getMenu1() {
        return MENU_1;
    }

    public void setMenu1(String menu1) {
        utils.put(MENU_1, menu1);
    }

    public static String getMenu2() {
        return MENU_2;
    }

    public void setMenu2(String menu2) {
        utils.put(MENU_2, menu2);
    }

    public static String getMenu3() {
        return MENU_3;
    }

    public void setMenu3(String menu3) {
        utils.put(MENU_3, menu3);
    }

    public static String getMenu4() {
        return MENU_4;
    }

    public void setMenu4(String menu4) {
        utils.put(MENU_4, menu4);
    }

    public static String getMenu5() {
        return MENU_5;
    }

    public void setMenu5(String menu5) {
        utils.put(MENU_5, menu5);
    }

    public static String getLoadingTitle() {
        return LOADING_TITLE;
    }

    public void setLoadingTitle(String loadingTitle) {
        utils.put(LOADING_TITLE, loadingTitle);
    }

    public String getCircleUrl() {
        return CIRCLE_URL;
    }

    public void setCircleUrl(String circleUrl) {
        utils.put(CIRCLE_URL, circleUrl);
    }


}